import java.util.Random;
//Base class of Producers and Consumers
abstract class Prosumer<T extends Comparable<T>> implements Runnable {
    protected int m_id;
    protected SyncHeap<T> m_sH;
    protected Random m_rand;
    protected javax.swing.JLabel m_label;
    protected double m_processTime; //either produce or consume time
    protected boolean m_useRandom;
    protected boolean m_printToStd;
    Prosumer(int id, SyncHeap<T> sHeap, javax.swing.JLabel label, double time, 
            boolean useRandom, boolean printToStd) {
	m_id = id;
	m_sH = sHeap;
	m_rand = new Random();
	m_label = label;
        m_processTime = time * 1000;   //Only used if not useRandom
        m_useRandom = useRandom;
        m_printToStd = printToStd;
    };
    @Override
    public void run() { process(); }
    abstract protected void process(); 
}
